package com.leyou.auth.utils;

import com.leyou.pojo.dto.UserDetail;

import javax.jws.soap.SOAPBinding;

/**
 * 对ThreadLocal做一个装饰，不让别人看出来是ThreadLocal
 */
public class UserHolder {
    private static final ThreadLocal<UserDetail>  tl = new ThreadLocal<>();

    /**
     * 存
     * @param user
     */
    public static void  set(UserDetail user){
        tl.set(user);
    }

    /**
     * 查
     * @return
     */

    public static UserDetail get(){
       return tl.get();
    }

    public static void  remove(){
        tl.remove();
    }

}
